/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("cal_plan",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using MES.Calendar.IServices;
using VOL.Entity.DTO.Plan;
using Microsoft.AspNetCore.Authorization;
using System.Numerics;

namespace MES.Calendar.Controllers
{
    public partial class cal_planController
    {
        private readonly Ical_planService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public cal_planController(
            Ical_planService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        [HttpPost, Route("AddPlan")]
        public IActionResult AddPlan([FromBody]PlanDto plan)
        {
         
         return Ok(_service.AddPlan(plan)); 
        }
        [HttpPost, Route("UpdatePlan")]
        public IActionResult UpdatePlan([FromBody]PlanDto plan)
        {
         
         return Ok(_service.UpdatePlan(plan)); 
        }

        [HttpGet, Route("GetBanzu")]
        public IActionResult GetBanzu(string palanId)
        {
            return JsonNormal(_service.GetBanzu(palanId));
          
        }

        [HttpPost, Route("DeletePlanss")]
        public IActionResult DeletePlanss([FromBody] List<string> ids)
        {
            return Ok(_service.DeletePlan(ids));
        }
    }
}
